package com.zhihu_lvliangi_android.option.zhengwu.adapter;

import java.util.List;

import com.zhihu_lvliangi_android.R;
import com.zhihu_lvliangi_android.domain.ZhengwuColumnItem;
import com.zhihu_lvliangi_android.util.ViewHolder;

import android.content.Context;
import android.renderscript.Element;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ColumnGridViewAdapter extends BaseAdapter {
	

	private Context mContext;
	private List<ZhengwuColumnItem> mColumnItems;
	public ColumnGridViewAdapter(Context context,List<ZhengwuColumnItem> ColumnItems) {
		mContext = context;
		mColumnItems = ColumnItems;
	}
	

	
	@Override
	public int getCount() {
		return mColumnItems.size();
	}

	@Override
	public ZhengwuColumnItem getItem(int position) {
		return mColumnItems.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
	
		if (convertView ==null) {
			convertView = LayoutInflater.from(mContext).inflate(R.layout.general_gridview_text_item, null);
		}
		TextView textView = ViewHolder.get(convertView, R.id.general_grid_view_item_txt);
		textView.setText(mColumnItems.get(position).getGuide_type_name());
		
		return convertView;
	}

}
